//
//  YTNavigationController.m
//  YiTuDriverClient
//
//  Created by 石少庸 on 2017/4/27.
//  Copyright © 2017年 Yitu. All rights reserved.
//

#import "YTNavigationController.h"

@interface YTNavigationController ()

@end

@implementation YTNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self configNaivgationBar];
}

- (void)configNaivgationBar {
//    self.navigationBar.translucent = NO;
    [self.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor]}];
    if (@available(iOS 11.0, *)) {
//        self.navigationBar.prefersLargeTitles = YES;
//        self.navigationController.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAutomatic;
    }
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    if (self.viewControllers.count > 0){
        @weakify(self);
        viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] bk_initWithImage:[UIImage imageNamed:@"public_back_black"] style:UIBarButtonItemStylePlain handler:^(id sender) {
            @strongify(self);
            [self popViewControllerAnimated:true];
        }];
    }
    [super pushViewController:viewController animated:animated];
}

@end
